
    <!DOCTYPE html>
    <html lang="zh-CN">
    <head>
      <meta charset="UTF-8">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>Maven vs Gradle：构建工具的对比与选择指南 - 学习卡片</title>
      <style>
        body { font-family: sans-serif; background-color: #f0f8ff; color: #333; display: flex; flex-direction: column; align-items: center; padding: 50px 20px; }
        .header h1 { font-size: 32px; }
        .grid-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; width: 100%; max-width: 1200px; }
        .card-container { perspective: 1200px; cursor: pointer; height: 250px; }
        .card { width: 100%; height: 100%; position: relative; transform-style: preserve-3d; transition: transform 0.7s; border-radius: 16px; box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
        .card-container.flipped .card { transform: rotateY(180deg); }
        .card-face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; display: flex; flex-direction: column; box-sizing: border-box; border-radius: 16px; background-color: #fff; padding: 24px; }
        .card-back { background-color: #f0fff4; transform: rotateY(180deg); justify-content: space-between; }
        .card-category { font-size: 14px; color: #0052d9; margin-bottom: 8px; font-weight: 500; }
        .card-question { font-size: 20px; font-weight: 500; flex-grow: 1; display: flex; align-items: center; justify-content: center; text-align: center; }
        .card-answer-wrapper { flex-grow: 1; overflow-y: auto; }
        .card-answer { font-size: 15px; line-height: 1.7; }
        .card-footer { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 16px; margin-top: 16px; }
        .card-source { font-size: 13px; color: #8a919f; border-top: 1px solid #f0f0f0; padding-top: 12px; margin-top: 12px; }
      </style>
    </head>
    <body>
      <div class="header">
        <h1>Maven vs Gradle：构建工具的对比与选择指南 - 学习卡片</h1>
      </div>
      <div class="grid-container">
        
    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">技术</div>
          <div class="card-question">Maven的核心设计原则是什么？它使用哪种格式作为配置文件？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">技术</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">Maven基于“约定优于配置”原则，提供了标准化的项目管理方式，并采用 XML 作为其配置文件格式。</div>
          </div>
          <div class="card-source">来源: 1.1 什么是 Maven？</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">特性</div>
          <div class="card-question">Gradle通过哪些特性来实现其高性能的构建速度？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">特性</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">Gradle主要通过三大特性实现高性能构建：1. 增量构建，只处理修改过的部分；2. 任务缓存，缓存任务结果以避免重复执行；3. 并行执行，默认支持任务并行以利用多核CPU。</div>
          </div>
          <div class="card-source">来源: 4. 构建速度对比</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">对比</div>
          <div class="card-question">Maven和Gradle在配置文件语法上有何主要区别？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">对比</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">Maven使用较为冗长的 XML (pom.xml) 进行配置，而 Gradle 使用更简洁、可读性更强的 Groovy 或 Kotlin DSL (build.gradle) 进行配置。</div>
          </div>
          <div class="card-source">来源: 2. 配置方式对比</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">机制</div>
          <div class="card-question">在Maven的依赖管理中，`provided`作用范围（scope）的含义是什么？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">机制</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">`provided`作用范围表示该依赖在编译时需要，但在运行时由外部容器（如Tomcat）提供，因此不会被打包进最终的产物中。</div>
          </div>
          <div class="card-source">来源: 3.1 Maven 依赖管理</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">机制</div>
          <div class="card-question">Gradle的`implementation`依赖范围与`api`依赖范围有何不同？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">机制</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">`implementation`声明的依赖仅在当前模块内部的编译和运行时可用，不会暴露给依赖此模块的其他模块。而`api`声明的依赖则会传递下去，对其他依赖此模块的模块也可见，效果类似于Maven的`compile`。</div>
          </div>
          <div class="card-source">来源: 3.2 Gradle 依赖管理</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">模式</div>
          <div class="card-question">根据文档，什么样的项目场景更适合选择Maven？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">模式</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">对于追求稳定性和成熟插件生态的传统企业级Java项目，例如Spring Boot或JEE应用，选择Maven更为合适。</div>
          </div>
          <div class="card-source">来源: 6. 适用场景对比</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">模式</div>
          <div class="card-question">文档推荐在哪些项目类型中使用Gradle？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">模式</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">对于追求高性能构建的现代项目，如微服务架构、大型项目以及Android开发，Gradle是更合适的选择。</div>
          </div>
          <div class="card-source">来源: 6. 适用场景对比</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">技术</div>
          <div class="card-question">请列举Maven提供的几个核心的默认生命周期阶段。</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">技术</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">Maven提供了一系列默认的生命周期阶段，包括 `clean`、`compile`、`test`、`package`、`install` 和 `deploy`。</div>
          </div>
          <div class="card-source">来源: 1.1 什么是 Maven？</div>
        </div>
      </div>
    </div>

    <div class="card-container" onclick="this.classList.toggle('flipped');">
      <div class="card">
        <div class="card-face card-front">
          <div class="card-category">特性</div>
          <div class="card-question">在Gradle中使用动态版本依赖（例如 '5.+'）存在什么潜在风险？</div>
          <div class="card-footer">点击卡片查看答案</div>
        </div>
        <div class="card-face card-back">
          <div class="card-category">特性</div>
          <div class="card-answer-wrapper">
            <div class="card-answer">使用动态版本依赖虽然方便，但可能会导致构建结果不稳定，因为每次构建时解析到的具体依赖版本可能不同。</div>
          </div>
          <div class="card-source">来源: 3.2 Gradle 依赖管理</div>
        </div>
      </div>
    </div>

      </div>
    </body>
    </html>
